gadget: Be careful in geometry calculations
authorMatthias Clasen <mclasen@redhat.com>
Sat, 13 Feb 2016 03:26:04 +0000 (22:26 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 13 Feb 2016 03:26:04 +0000 (22:26 -0500)
commit51af70495ae1be03c4faadbbfe91234f165ddcaa
tree5102a661aab69d47db591b2e5b813aaec5847606
parent71559c603e8cfdbe7cba03344f244a6ce84545a4
gadget: Be careful in geometry calculations

Margins can be negative, and if we are not careful, then
content+padding+margin can end up with negative dimensions,
which can upset pixman and others. This commit ensures
that a gadget will not request or draw boxes with negative
dimensions, and get_border_allocation and get_content_allocation
will not return boxes with negative dimensions.

This fixes a crash in the paned separator drawing code that
can be reproduced by setting separator padding to 0.

https://bugzilla.gnome.org/show_bug.cgi?id=759657
gtk/gtkcssgadget.c